<template>
  <view>
    <u-swipe-action @click="ckThis2($event, item)">
      <view v-for="i in lists1" :key="i.id">
        <view>
          {{'titile' + i.id}}
        </view>  
        <u-swipe-action-item v-for="item in i.list" :key="i.id + '-' + item.id" :options="options1" @click="removeFn($event, item)">
          <view class="swipe-action u-border-top u-border-bottom">
            <view class="swipe-action__content" @click="ckThis(item)">
              <text class="swipe-action__content__text">{{ item.name }}</text>
            </view>
          </view>
        </u-swipe-action-item>
      </view>
    </u-swipe-action>
  </view>
</template>

<script>
export default {
  name: 'Home',
  data() {
    return {
      options1: [
        {
          text: '删除'
        }
      ],
      lists1: [
        {
          id: 1,
          list: [
            {
              id: 1,
              name: 'xx0'
            },
            {
              id: 2,
              name: 'xx1'
            },
            {
              id: 3,
              name: 'xx2'
            },
            {
              id: 4,
              name: 'xx3'
            }
          ]
        },
        {
          id: 2,
          list: [
            {
              id: 1,
              name: 'xx0'
            },
            {
              id: 2,
              name: 'xx1'
            },
            {
              id: 3,
              name: 'xx2'
            },
            {
              id: 4,
              name: 'xx3'
            }
          ]
        }
      ]
    };
  },
  methods: {
    getData() {
      return {
        num: 22
      };
    },
    ckThis(e) {
      console.log('click');
    },
    ckThis2(e, item) {
      console.log('click2');
      console.log(e);
      console.log(item);
    },
    removeFn(e, item) {
      console.log(e);
      console.log(item);
    }
  }
};
</script>

<style scoped lang="scss">
// .u-page {
//   padding: 0;
// }

// .u-demo-block__title {
//   padding: 10px 0 2px 15px;
// }

// .swipe-action {
//   &__content {
//     padding: 25rpx 0;

//     &__text {
//       font-size: 15px;
//       color: $u-main-color;
//       padding-left: 30rpx;
//     }
//   }
// }
</style>
